All files / api/middlewares scopeMiddleware.js

0% Statements 0/2
100% Branches 0/0
0% Functions 0/2
0% Lines 0/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19                                     
/**
 * Request szintű DI scope létrehozása
 * Middleware ami minden kéréshez új DI scope-ot készít
 */
function scopeMiddleware(container) {
  return (req, res, next) => {
    // TODO 1: Hozz létre request-specifikus scope-ot
    // Tipp: const scope = container.createScope();
    
    // TODO 2: Tárold el a scope-ot req.scope alatt
    // Tipp: req.scope = scope;
    
    // TODO 3: Hívd meg a next()-et
    // Tipp: next();
  };
}
 
module.exports = scopeMiddleware;